package cn.yitun.chat.yitunserverimapicore.business.chat.action;

import cn.yitun.chat.yituncommonmessage.impl.HeadImpl;
import cn.yitun.chat.yitungeneral.annotation.action.ActionMapping;
import cn.yitun.chat.yitungeneral.annotation.parameter.JsonDefine;
import cn.yitun.chat.yitunservercommonlib.constant.ActionTypeConstant;
import cn.yitun.chat.yitunservercommonlib.dataentity.dto.group.GroupChatContentDto;
import cn.yitun.chat.yitunservercommonlib.util.codec.IdGen;
import cn.yitun.chat.yitunserverimapicore.business.chat.service.GroupChatService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@ActionMapping(value = ActionTypeConstant.GROUP_CHAT_ACTION_PUSH)
public class GroupChatAction {

	@Resource
	GroupChatService groupChatService;

	/**
	 * Date 2019-02-17 12:26:38<br>
	 * Description 群聊
	 * @author yitun<br>
	 * @version 1.1
	 * @param head
	 * @param query
	 */
	@ActionMapping(value = "1.1.0001")
	public void groupChat(HeadImpl head,
			@JsonDefine("data") GroupChatContentDto query) {
		Long key = null == head.getKey() ? IdGen.getNumber() : head.getKey();
		groupChatService.groupChat(key, query);
	}

}
